#include<bits/stdc++.h>
using namespace std;
int main(){
    string v="";
    int flag =0;
    stack<float> s;
    string str;
    getline(cin,str);
    for(int i=str.size()-1;i>=0;i--){
        char c = str[i];
        v = v+c;
    }
    for(int i = 0;i<v.size();i++){
        string digital =" ";//方便字符串的拼接
        if(v[i]=='+'||v[i]=='-'||v[i]=='/'||v[i]=='*'){
            double num1 = s.top();
            s.pop();
            double num2 = s.top();
            s.pop();
            double num;
            if(v[i]=='+')
                num = num1+num2;
            if(v[i]=='-')
                num = num1-num2;
            if(v[i]=='/'){
                if(num2==0){
                    flag = 1;
                    break;
                }
                num = num1/num2;
            }
            if(v[i]=='*')
                num = num1*num2;
            s.push(num);
            i++;
        }else{
            while(i<v.size()&&v[i]!=' '){
                digital = v[i]+digital;
                i++;
            }
            float temp = atof(digital.c_str());
            s.push(temp);
        }
    }
    float result = s.top();
    if(flag==0){printf("%.1lf",result);}else{cout<<"ERROR";}
}
